use "C:\Users\sony\Google Drive\Opiniao Publica RI\Experimentos Survey\Feliciano\FPA - Dados revisao\brasil_2014_base_original_site.dta", clear

****************************************************************************
********************************* TABLES ***********************************
****************************************************************************


*** FIRST SET OF EXPERIMENTS


**********************************************
*** 1o EXPERIMENT - SCENARIO 1 - REGIME CHANGE
**********************************************
br Q_75 Q_76 Q_77 Q_78 Q_79 
** CREATING DEPENDENT VARIABLE
gen experimento2VD = Q_77 if Q_77!=-1
*replace experimento2VD = Q_77 if Q_77!=-1
replace experimento2VD = Q_78 if Q_78!=-1
replace experimento2VD = Q_79 if Q_79!=-1
** ORGANIZING DEPENDENT VARIABLE
replace experimento2VD = 95 if  experimento2VD  ==1 // Concordo totalmente 
replace experimento2VD = 94 if  experimento2VD  ==2 // Concordo em parte 
*replace experimento2VD = 3 if  experimento2VD  ==3 // Nem concordo nem discordo
replace experimento2VD = 92 if  experimento2VD  ==4 // Discordo em parte
replace experimento2VD = 91 if  experimento2VD  ==5 // Discordo totalmente 
replace experimento2VD = . if  experimento2VD  ==6 // NS
replace experimento2VD = . if  experimento2VD  ==7 // NR 
**
replace experimento2VD = 5 if  experimento2VD  ==95 // Concordo totalmente 
replace experimento2VD = 4 if  experimento2VD  ==94 // Concordo em parte 
replace experimento2VD = 2 if  experimento2VD  ==92 // Discordo em parte
replace experimento2VD = 1 if  experimento2VD  ==91 // Discordo totalmente 
** CREATING INDEPENDENT VARIABLE
gen experimento2VI = Q_76
replace experimento2VI =0 if Q_76 == 3
*Q_76 == 3 // baseline category: NO ACTION

** DESCRIPTIVE DATA - TABLE 1
sum experimento2VD if experimento2VI == 0
sum experimento2VD if experimento2VI == 1
sum experimento2VD if experimento2VI == 2

** REGRESSION ANALYSIS - TABLE 3
reg experimento2VD i.experimento2VI

** T-TEST - TABLE 2
gen exper2VI_1=0 if experimento2VI !=.
replace exper2VI_1=1 if experimento2VI ==1

gen exper2VI_2=0 if experimento2VI !=.
replace exper2VI_2=1 if experimento2VI ==2

** Comparison Cat 1 (Economic Sanctions) & Cat 0 (Not Acting)
ttest experimento2VD if experimento2VI!=2, by( exper2VI_1)
** Comparison Cat 2 (Multilateral Condemnation) & Cat 0 (Not Acting)
ttest experimento2VD if experimento2VI!=1, by( exper2VI_2)
** Comparison Cat 1 (Economic Sanctions) & Cat 2 (Multilateral Condemnation)
ttest experimento2VD if experimento2VI!=0, by(exper2VI_1)

****************************************************
***1o EXPERIMENT - SCENARIO 2 - REGIONAL CONFLICT
****************************************************
br Q_85 Q_86 Q_87 Q_88 Q_89

** CREATING DV
gen experimento4VD = Q_87 if Q_87!=-1
*replace experimento4VD = Q_87 if Q_87!=-1
replace experimento4VD = Q_88 if Q_88!=-1
replace experimento4VD = Q_89 if Q_89!=-1

** organizando DV
replace experimento4VD = 95 if  experimento4VD  ==1 // Concordo totalmente
replace experimento4VD = 94 if  experimento4VD  ==2 // Concordo em parte 
*replace experimento4VD = 3 if  experimento4VD  ==3 // Nem concordo nem discordo
replace experimento4VD = 92 if  experimento4VD  ==4 // Discordo em parte
replace experimento4VD = 91 if  experimento4VD  ==5 // Discordo totalmente 
replace experimento4VD = .  if  experimento4VD  ==6 // NS
replace experimento4VD = .  if  experimento4VD  ==7 // NR 
**
replace experimento4VD = 5 if  experimento4VD  ==95 // Concordo totalmente
replace experimento4VD = 4 if  experimento4VD  ==94 // Concordo em parte 
replace experimento4VD = 2 if  experimento4VD  ==92 // Discordo em parte
replace experimento4VD = 1 if  experimento4VD  ==91 // Discordo totalmente 

** creating IV
gen experimento4VI = Q_86
replace experimento4VI =. if Q_86 == -1
replace experimento4VI =0 if Q_86 == 3
*Q_81 == 3 // baseline category: NO ACTION

** ** DESCRIPTIVE DATA - TABLE 1
sum experimento4VD if experimento4VI == 0
sum experimento4VD if experimento4VI == 1
sum experimento4VD if experimento4VI == 2

** REGRESSION ANALYSIS - TABLE 3
reg experimento4VD i.experimento4VI

** T-TEST - TABLE 2
gen exper4VI_1=0 if experimento4VI !=.
replace exper4VI_1=1 if experimento4VI ==1

gen exper4VI_2=0 if experimento4VI !=.
replace exper4VI_2=1 if experimento4VI ==2

** Comparison Cat 1 (Economic Sanctions) & Cat 0 (Not Acting)
ttest experimento4VD if experimento4VI!=2, by( exper4VI_1)
** Comparison Cat 2 (Multilateral Condemnation) & Cat 0 (Not Acting)
ttest experimento4VD if experimento4VI!=1, by( exper4VI_2)
** Comparison Cat 1 (Economic Sanctions) & Cat 2 (Multilateral Condemnation)
ttest experimento4VD if experimento4VI!=0, by(exper4VI_1)


****************************************************
***1o EXPERIMENT - SCENARIO 3 - ECONOMIC INTEGRATION
****************************************************
br Q_80 Q_81 Q_82 Q_83 Q_84
** CREATING DP
gen experimento3VD = Q_82 if Q_82!=-1
*replace experimento3VD = Q_82 if Q_82!=-1
replace experimento3VD = Q_83 if Q_83!=-1
replace experimento3VD = Q_84 if Q_84!=-1
** ORGANIZING DP
replace experimento3VD = 95 if  experimento3VD  ==1 // Concordo totalmente
replace experimento3VD = 94 if  experimento3VD  ==2 // Concordo em parte 
*replace experimento3VD = 3 if  experimento3VD  ==3 // Nem concordo nem discordo
replace experimento3VD = 92 if  experimento3VD  ==4 // Discordo em parte
replace experimento3VD = 91 if  experimento3VD  ==5 // Discordo totalmente 
replace experimento3VD =  . if  experimento3VD  ==6 // NS
replace experimento3VD =  . if  experimento3VD  ==7 // NR 
**
replace experimento3VD = 5 if  experimento3VD  ==95 // Concordo totalmente
replace experimento3VD = 4 if  experimento3VD  ==94 // Concordo em parte 
replace experimento3VD = 2 if  experimento3VD  ==92 // Discordo em parte
replace experimento3VD = 1 if  experimento3VD  ==91 // Discordo totalmente 

** CREATING VI
gen experimento3VI = Q_81
replace experimento3VI =. if Q_81 == -1
replace experimento3VI =0 if Q_81 == 3
*Q_81 == 3 // baseline category: NO ACTION

** ** DESCRIPTIVE DATA - TABLE 1
sum experimento3VD if experimento3VI == 0
sum experimento3VD if experimento3VI == 1
sum experimento3VD if experimento3VI == 2

** REGRESSION ANALYSIS - TABLE 3
reg experimento3VD i.experimento3VI

** T-TEST - TABLE 2
gen exper3VI_1=0 if experimento3VI !=.
replace exper3VI_1=1 if experimento3VI ==1

gen exper3VI_2=0 if experimento3VI !=.
replace exper3VI_2=1 if experimento3VI ==2

** Comparison Cat 1 (Economic Sanctions) & Cat 0 (Not Acting)
ttest experimento3VD if experimento3VI!=2, by( exper3VI_1)
** Comparison Cat 2 (Multilateral Condemnation) & Cat 0 (Not Acting)
ttest experimento3VD if experimento3VI!=1, by( exper3VI_2)
** Comparison Cat 1 (Economic Sanctions) & Cat 2 (Multilateral Condemnation)
ttest experimento3VD if experimento3VI!=0, by(exper3VI_1)
********************************************************


*** SECOND SET OF EXPERIMENTS



**********************************************
*** 2o EXPERIMENT - SCENARIO 4 - REGIME CHANGE
**********************************************
br Q_176 Q_177 Q_178 Q_179 Q_180 Q_181 Q_182 Q_183 Q_184 Q_185

gen experimento6VD = Q_178 if Q_178!=-1
replace experimento6VD = Q_179 if Q_179!=-1
replace experimento6VD = Q_180 if Q_180!=-1
replace experimento6VD = Q_181 if Q_181!=-1
replace experimento6VD = Q_182 if Q_182!=-1
replace experimento6VD = Q_183 if Q_183!=-1
replace experimento6VD = Q_184 if Q_184!=-1
replace experimento6VD = Q_185 if Q_185!=-1

** CREATING VD
replace experimento6VD = 95 if  experimento6VD  ==1  // Concordo totalmente
replace experimento6VD = 94	if  experimento6VD  ==2   // Concordo em parte 
*replace experimento6VD = 3 if  experimento6VD  ==3  // Nem concordo nem discordo
replace experimento6VD = 92 if  experimento6VD  ==4  // Discordo em parte
replace experimento6VD = 91 if  experimento6VD  ==5  // Discordo totalmente 
replace experimento6VD = .  if  experimento6VD  ==6  // NS
replace experimento6VD = .  if  experimento6VD  ==7  // NR 
**
replace experimento6VD = 5 if  experimento6VD  ==95  // Concordo totalmente
replace experimento6VD = 4 if  experimento6VD  ==94   // Concordo em parte 
replace experimento6VD = 2 if  experimento6VD  ==92  // Discordo em parte
replace experimento6VD = 1 if  experimento6VD  ==91  // Discordo totalmente 


** CREATING VI
** COUNTRY VARIABLES: URUGUAY(0) x VENEZUELA (1)
gen experimento6VIa = Q_177
replace experimento6VIa =. if Q_177 == -1
replace experimento6VIa = 1 if Q_177 == 1
replace experimento6VIa = 1 if Q_177 == 3
replace experimento6VIa = 1 if Q_177 == 5
replace experimento6VIa = 1 if Q_177 == 7
**
replace experimento6VIa = 0 if Q_177 == 2
replace experimento6VIa = 0 if Q_177 == 4
replace experimento6VIa = 0 if Q_177 == 6
replace experimento6VIa = 0 if Q_177 == 8
label variable experimento6VIa "Venezuela - Uruguai"

*** RESPONSE VARIABLES: 
*NO ACTION - 0
*ECONOMIC SANCTIONS - 1
*MULTILATERAL CONDEMNATION - 2
*DIPLOMATIC BREAKDOWN - 3

gen experimento6VIb = Q_177
replace experimento6VIb =. if Q_177 == -1
replace experimento6VIb = 1 if Q_177 == 1
replace experimento6VIb = 1 if Q_177 == 2
replace experimento6VIb = 2 if Q_177 == 3
replace experimento6VIb = 2 if Q_177 == 4
***
replace experimento6VIb = 3 if Q_177 == 5
replace experimento6VIb = 3 if Q_177 == 6
replace experimento6VIb = 0 if Q_177 == 7
replace experimento6VIb = 0 if Q_177 == 8


** ** DESCRIPTIVE DATA - TABLE 4
** COUNTRY VARIABLES
sum experimento6VD if experimento6VIa == 0
sum experimento6VD if experimento6VIa == 1

** TREATMENT VARIABLES
sum experimento6VD if experimento6VIb == 0
sum experimento6VD if experimento6VIb == 1
sum experimento6VD if experimento6VIb == 2
sum experimento6VD if experimento6VIb == 3

** REGRESSION ANALYSIS - TABLE 5
reg experimento6VD i.experimento6VIa##i.experimento6VIb

**********************************************
*** 2o EXPERIMENT - SCENARIO 5 - REGIONAL CONFLICT
**********************************************
br Q_186 Q_187 Q_188 Q_189 Q_190 Q_191 Q_192 Q_193 Q_194 Q_195

gen experimento7VD = Q_188 if Q_188!=-1
replace experimento7VD = Q_189 if Q_189!=-1
replace experimento7VD = Q_190 if Q_190!=-1
replace experimento7VD = Q_191 if Q_191!=-1
replace experimento7VD = Q_192 if Q_192!=-1
replace experimento7VD = Q_193 if Q_193!=-1
replace experimento7VD = Q_194 if Q_194!=-1
replace experimento7VD = Q_195 if Q_195!=-1

** CREATING DV
replace experimento7VD = 95 if  experimento7VD  ==1 // Concordo totalmente
replace experimento7VD = 94 if  experimento7VD  ==2 // Concordo em parte 
*replace experimento7VD = 3 if  experimento7VD  ==3 // Nem concordo nem discordo
replace experimento7VD = 92 if  experimento7VD  ==4 // Discordo em parte
replace experimento7VD = 91 if  experimento7VD  ==5 // Discordo totalmente 
replace experimento7VD = .  if  experimento7VD  ==6 // NS
replace experimento7VD = .  if  experimento7VD  ==7 // NR 
**
replace experimento7VD = 5 if  experimento7VD  ==95 // Concordo totalmente
replace experimento7VD = 4 if  experimento7VD  ==94 // Concordo em parte 
replace experimento7VD = 2 if  experimento7VD  ==92 // Discordo em parte
replace experimento7VD = 1 if  experimento7VD  ==91 // Discordo totalmente 

** CREATING IV
** COUNTRY VARIABLES: CHILE - ARGENTINA (0) x VENEZUELA - COLOMBIA (1)
gen experimento7VIa = Q_187
replace experimento7VIa =. if Q_187 == -1
replace experimento7VIa = 0 if Q_187 == 1
replace experimento7VIa = 0 if Q_187 == 3
replace experimento7VIa = 0 if Q_187 == 5
replace experimento7VIa = 0 if Q_187 == 7

replace experimento7VIa = 1 if Q_187 == 2
replace experimento7VIa = 1 if Q_187 == 4
replace experimento7VIa = 1 if Q_187 == 6
replace experimento7VIa = 1 if Q_187 == 8
label variable experimento7VIa "Ven-Col x Arg-Chile"

*** RESPONSE VARIABLES: 
*NO ACTION - 0
*ECONOMIC SANCTIONS - 1
*MULTILATERAL CONDEMNATION - 2
*DIPLOMATIC BREAKDOWN - 3

gen experimento7VIb = Q_187
replace experimento7VIb =. if Q_187 == -1
replace experimento7VIb = 1 if Q_187 == 1
replace experimento7VIb = 1 if Q_187 == 2
replace experimento7VIb = 2 if Q_187 == 3
replace experimento7VIb = 2 if Q_187 == 4

replace experimento7VIb = 3 if Q_187 == 5
replace experimento7VIb = 3 if Q_187 == 6
replace experimento7VIb = 0 if Q_187 == 7
replace experimento7VIb = 0 if Q_187 == 8

		
** ** DESCRIPTIVE DATA - TABLE 4
** COUNTRY VARIABLES
sum experimento7VD if experimento7VIa == 0
sum experimento7VD if experimento7VIa == 1

** TREATMENT VARIABLES
sum experimento7VD if experimento7VIb == 0
sum experimento7VD if experimento7VIb == 1
sum experimento7VD if experimento7VIb == 2
sum experimento7VD if experimento7VIb == 3

** REGRESSION ANALYSIS - TABLE 5
reg experimento7VD i.experimento7VIa##i.experimento7VIb



******************************************
** APPENDIX -- ORDINAL LOGIT ESTIMATIONS
******************************************

** 1st SET OF EXPERIMENTS
** OLOGIT ESTIMATIONS - TABLE A2
**** coefficients and OR
ologit experimento2VD i.experimento2VI, or
outreg, se starlevels(10 5 1) bdec(3) 
ologit experimento4VD i.experimento4VI, or
outreg, se starlevels(10 5 1) bdec(3) merge
ologit experimento3VD i.experimento3VI, or
outreg, se starlevels(10 5 1) bdec(3) merge

** 2nd SET OF EXPERIMENTS
** OLOGIT ESTIMATIONS - TABLE A3
**** coefficients and OR
ologit experimento6VD i.experimento6VIa##i.experimento6VIb, or
outreg, se starlevels(10 5 1) bdec(3) 
ologit experimento7VD i.experimento7VIa##i.experimento7VIb, or
outreg, se starlevels(10 5 1) bdec(3) merge







** AFTER DOFILES
do "C:\Users\sony\Google Drive\Opiniao Publica RI\Experimentos Survey\Feliciano\FPA - Dados revisao\FPA Feliciano et al _ FIGURES.do"

